/**登录**/
function loginSr(){
  if (window.localStorage){
    var username=localStorage.getItem("username");
    if(username){
      $.afui.popup("您已登录，请勿重复登录");
      return false;
    }
  }

  var lgusernae=$("#lgusernae").val();
  var lgpw=$("#lgpw").val();
  if(lgusernae==""){
    $.afui.popup("请输入账户名称！");
    return false;
  }
  if(lgpw==""){
    $.afui.popup("请输入密码！");
    return false;
  }

  $.getJSON(loginServer.getLoginReq(lgusernae,lgpw),function(data){
    if(data.success==true){
      //console.log(data);
      $.afui.popup(data.msg);
      if (window.localStorage){
        localStorage.setItem("username",data.obj.telephone.toString());
      }
      $("#username").val(data.obj.telephone);
    }else{
      $.afui.popup(data.msg);
    }
  });
}
